home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HAM Radio 1997
/
HAM Radio 1997.iso
/
vcls
/
moden
/
examples
/
exdial0.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1996-04-08
|
3KB
|
116 lines
unit Exdial0;
interface
uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Forms, Dialogs, AdModem, AdPort, StdCtrls, Buttons;
type
TForm1 = class(TForm)
ListBox1: TListBox;
BitBtn1: TBitBtn;
ApdComPort1: TApdComPort;
ApdModem1: TApdModem;
procedure ApdModem1DialCount(M: TObject; Remaining: Word);
procedure ApdModem1DialTimedOut(Sender: TObject);
procedure ApdModem1GotDataCompression(Sender: TObject);
procedure ApdModem1GotErrCorrection(Sender: TObject);
procedure ApdModem1GotLineSpeed(M: TObject; Speed: Longint);
procedure ApdModem1ModemBusy(Sender: TObject);
procedure ApdModem1ModemConnect(Sender: TObject);
procedure ApdModem1ModemError(Sender: TObject);
procedure ApdModem1ModemNoCarrier(Sender: TObject);
procedure ApdModem1ModemNoDialTone(Sender: TObject);
procedure ApdModem1ModemVoice(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure AddStatus(const Msg : String);
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.AddStatus(const Msg : String);
begin
Listbox1.Items.Add(Msg);
Listbox1.ItemIndex := Pred(Listbox1.Items.Count);
end;
procedure TForm1.ApdModem1DialCount(M: TObject; Remaining: Word);
begin
AddStatus('Still dialing. ' + IntToStr(Remaining) + ' seconds remaining.');
end;
procedure TForm1.ApdModem1DialTimedOut(Sender: TObject);
begin
AddStatus('Timed out waiting for remote to answer');
end;
procedure TForm1.ApdModem1GotDataCompression(Sender: TObject);
begin
AddStatus('This connection supports data compression');
end;
procedure TForm1.ApdModem1GotErrCorrection(Sender: TObject);
begin
AddStatus('This is an error correcting connection');
end;
procedure TForm1.ApdModem1GotLineSpeed(M: TObject; Speed: Longint);
begin
AddStatus('Connected at ' + IntToStr(Speed) + ' baud');
end;
procedure TForm1.ApdModem1ModemBusy(Sender: TObject);
begin
AddStatus('Remote was busy');
end;
procedure TForm1.ApdModem1ModemConnect(Sender: TObject);
begin
AddStatus('Connected!');
end;
procedure TForm1.ApdModem1ModemError(Sender: TObject);
begin
AddStatus('Modem returned ERROR');
end;
procedure TForm1.ApdModem1ModemNoCarrier(Sender: TObject);
begin
AddStatus('Connection lost');
end;
procedure TForm1.ApdModem1ModemNoDialTone(Sender: TObject);
begin
AddStatus('No dialtone. Check cables.');
end;
procedure TForm1.ApdModem1ModemVoice(Sender: TObject);
begin
AddStatus('Remote answered with voice');
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
ApdComPort1.Open := True;
ApdModem1.Started := True;
end;
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
ApdModem1.Dial('260-9726');
end;
end.